public class UsbTest {
    public static void main(String[] args) {
        computer c1 = new computer();
        Copymachine p1 = new Copymachine();
        c1.TestData(p1);
        System.out.println();
        //
        c1.TestData(new Copymachine());
        //
        USB u1 = new USB() {
            @Override
            public void start() {

            }

            @Override
            public void stop() {

            }
        };
        c1.TestData(new USB() {
            @Override
            public void start() {

            }

            @Override
            public void stop() {

            }
        });
    }
}
interface USB{

    void start();
    void stop();
}
class computer{
    public void TestData(USB usb){
        System.out.println("正在连接...");
        usb.start();
        System.out.println("进行中...");
        usb.start();
    }
}
class Copymachine implements USB{

    @Override
    public void start() {
        System.out.println("开始打印...");
    }

    @Override
    public void stop() {
        System.out.println("打印结束...");
    }
}